﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System.Reflection;
using Excel;
using UnityEditor;
using System;
using System.IO;
using System.Text;

public class Serialization : SingletonMono<Serialization>
{
    public enum StructType
    {
        eDictionary,
        eList,
        ePrivateStruct,
        eNormal,
    }

    public static StructType CheckType(Type type)
    {
        if (typeof(IDictionary).IsAssignableFrom(type))
        {
            return StructType.eDictionary;
        }
        else if (typeof(IList).IsAssignableFrom(type))
        {
            return StructType.eList;
        }
        else if (IsBulitinType(type))
        {
            return StructType.eNormal;
        }
        else
        {
            return StructType.ePrivateStruct;
        }
    }


    private static bool IsBulitinType(Type type)
    {
        return (type == typeof(object) || Type.GetTypeCode(type) != TypeCode.Object);
    }
    public static List<T> IListToList<T>(IList<T> list)
    {
        T[] array = new T[list.Count];
        list.CopyTo(array, 0);
        return new List<T>(array);
    }

    private  void DealListData(  Dictionary<string,List<string>> list, ref int deepKey)
    {

    }
    private  void DealListData(string sheetName,List<string> list) 
    {

    }

}
